-- GENERATED SPELL FOR [Image of Arcanagos] --


function spell0_17652(pUnit, Event) --@Notify Medivh of Arcanagos\' Flee,Self--
pUnit:FullCastSpellOnTarget(30985,pUnit)
pUnit:RegisterEvent('Sorts_17652', 595, 1)
end

function spell1_17652(pUnit, Event) --@Prepare For Fireball,Self--
pUnit:FullCastSpellOnTarget(30970,pUnit)
pUnit:RegisterEvent('Sorts_17652', 547, 1)
end

function spell2_17652(pUnit, Event) --@Reflection,Self--
pUnit:FullCastSpellOnTarget(30969,pUnit)
pUnit:RegisterEvent('Sorts_17652', 10264, 1)
end

function spell3_17652(pUnit, Event) --@Shoot Uber Fireball,Self--
pUnit:FullCastSpellOnTarget(30968,pUnit)
pUnit:RegisterEvent('Sorts_17652', 571, 1)
end

function spell4_17652(pUnit, Event) --@Uber Fireball Reflect,n/a--
pUnit:FullCastSpellOnTarget(30971,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17652', 652, 1)
end

function Sorts_17652(pUnit, Event)
local choix_sorts_17652 = math.random(0, 4)
if choix_sorts_17652 == 0 then
pUnit:RegisterEvent('spell0_17652', 1, 1)
end
if choix_sorts_17652 == 1 then
pUnit:RegisterEvent('spell1_17652', 1, 1)
end
if choix_sorts_17652 == 2 then
pUnit:RegisterEvent('spell2_17652', 1, 1)
end
if choix_sorts_17652 == 3 then
pUnit:RegisterEvent('spell3_17652', 1, 1)
end
if choix_sorts_17652 == 4 then
pUnit:RegisterEvent('spell4_17652', 1, 1)
end
end

function mob17652_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17652', math.random(1500, 3000), 1)
end

function mob17652_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17652_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17652_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17652, 1, 'mob17652_Action')
RegisterUnitEvent(17652, 2, 'mob17652_Leave')
RegisterUnitEvent(17652, 3, 'mob17652_Kill')
RegisterUnitEvent(17652, 4, 'mob17652_Die')
